#include "bullet.h"

Bullet::Bullet(QObject *parent)

{
    mObjectType=GameObject::OT_BulletPlayer;
}

void Bullet:: BulletMove(QPoint B_dir)
{
    this->moveBy(B_dir.x()*B_speed,B_dir.y()*B_speed);
}

void Bullet::PlaySound()
{
    mbulletmedia1.setMedia(QUrl("qrc:/gongji1.mp3"));
    mbulletmedia1.play();
}

void Bullet::Init(QPoint B_pos, QPixmap B_pix, int zy)
{
    this->setPos(B_pos);
    this->setPixmap(B_pix);
    B_speed=8;
    this->setScale(0.7);//缩放
    B_zy=zy;

    PlaySound();
}

void Bullet::PlayBoomSound()
{
    mbulletmedia2.setMedia(QUrl("qrc:/gongji2.mp3"));
    mbulletmedia2.play();

}
